let arr = [1, 6, 7, 8, 2, 3, 4, 5]

// let res = arr.toSorted()
// console.log(res, arr);

// let res = arr.filter((item, i) => {
//   return item % 2 == 0
// })
// console.log(res)

// let arr2 = []
// let a = arr2.every(() => {})
// console.log(a);

let sum = arr.reduce((pre, item, i, abc) => {
  return pre + item
}, 0)

console.log(sum);
